package com.think.service.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

/*
 *
 * 注意：
 * 1、Configuration所在包需要和Application启动类所在包平级或下面
 * 2、模块之间注意在依赖关系，web依赖service层
 * */
@Configuration
@PropertySource(value = {"classpath:init.properties"}, ignoreResourceNotFound = false, encoding = "utf-8")
public class ServiceConfig {
    private Logger logger = LoggerFactory.getLogger("service");

    public ServiceConfig() {
        logger.info("service config...");
    }

    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }
}
